<?php echo $this->render('header.phtml'); ?>
<h2><?php echo $this->escape($this->content_title);?></h2>

<form>
<table border="0" cellpadding="3">
<tr>

<td> Уровень </td> <td colspan="2">
<select id="complexity" name="complexity" size="1" style="width:170px;">
    <option value="">Все</option>
    <?php foreach($this->complexitys as $key=>$value) { ?> 
    <option value="<?php echo $key;?>" 
    <?php echo $this->escape(trim($this->item->complexity))==$key?' selected ':'';?>>
    <?php echo $value ;?></option>
    <?php } ?>
</select>
</td>
<td>
<a href="javascript:document.forms[0].submit();" class="bt_blue"><span class="bt_blue_lft"></span><strong>Искать</strong><span class="bt_blue_r"></span></a>
</td></tr>
<table>
</form>
<?php if($this->can_add) { ?>
<a class="bt_green" href="/testsetup/add"><span class="bt_green_lft"></span><strong>Добавить</strong><span class="bt_green_r"></span></a>
<?php } ?>
<table summary="Tests" id="rounded-corner">
    <thead>
        <tr>
            <th class="rounded-company" scope="col"></th>
            <th class="rounded" scope="col">Question</th>
            <th class="rounded" scope="col">Answers</th>
            <th class="rounded" scope="col">Correct</th>
            <th class="rounded" scope="col">Complexity</th>
            <?php if($this->can_delete) { ?>
            <th class="rounded-q4" scope="col">Delete</th>
            <?php } ?>
        </tr>
    </thead>
    <!--<tfoot>
        <tr>
            <td class="rounded-foot-left" colspan="6"><em>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut.</em></td>
            <td class="rounded-foot-right">&nbsp;</td>

        </tr>
    </tfoot>-->
    <tbody>
<?php foreach($this->items as $obj) : ?>
        <tr>
            <td><input type="checkbox" name=""></td>
            <?php if($this->can_edit) { ?>
            <td><a href="/testsetup/edit/id/<?php echo $obj->id ?>"><?php echo $this->escape($obj->question);?></a></td>
            <?php } else { ?>
            <td><?php echo $this->escape($obj->question);?></td>
            <?php } ?>
            <td><?php echo $this->escape($obj->answers);?></td>
            <td><?php echo $this->escape($obj->correct);?></td>
            <td><?php echo $this->escape($obj->complexity);?></td>
            <?php if($this->can_delete) { ?>
            <td><a class="ask" href="/testsetup/delete/id/<?php echo $obj->id ?>"><img border="0" title="" alt="" src="/public/images/trash.png"></a></td>
            <?php } ?>
        </tr>
<?php endforeach; ?>
               
    </tbody>
</table>
<?php if($this->can_add) { ?>
<a class="bt_green" href="/testsetup/add"><span class="bt_green_lft"></span><strong>Добавить</strong><span class="bt_green_r"></span></a>
<?php } ?>
<?php echo $this->render('footer.phtml'); ?>
